<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2024/9/4
  Time: 9:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <meta charset="utf-8">
  <title>Space</title>
  <link href="https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
  <link href="https://cdn.bootcss.com/bootstrap-fileinput/4.4.7/css/fileinput.min.css" media="all" rel="stylesheet"
        type="text/css"/>
  <link rel="stylesheet" href="./css/style.css">
</head>
<body>
<div id="wrapper" class="toggled">
  <nav class="navbar navbar-inverse navbar-fixed-top" id="sidebar-wrapper" role="navigation">
    <ul class="nav sidebar-nav">
      <li class="sidebar-brand">
        <a href="/categoryList">
          商家管理系统
        </a>
      </li>
      <li class="sidebar-brand">
        <a href="#">
          您好, ${userName}
        </a>
      </li>
      <li>
        <a href="/userServlet"><i class="fa fa-fw fa-list-alt"></i> 用户管理</a>
      </li>
      <li>
        <a href="/UserInsertServlet"><i class="fa fa-fw fa-list-alt"></i> 用户新增</a>
      </li>
      <li>
        <a href="/productInfoByPageServlet"><i class="fa fa-fw fa-list-alt"></i> 类目管理</a>
      </li>
      <li>
        <a href="/productListOperate?operate=add"><i class="fa fa-fw fa-list-alt"></i> 类目新增</a>
      </li>
      <li class="dropdown open">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true"><i
                class="fa fa-fw fa-plus"></i> 商品 <span class="caret"></span></a>
        <ul class="dropdown-menu" role="menu">
          <li class="dropdown-header">操作</li>
          <li><a href="/productInfoByPageServlet">列表</a></li>
          <li><a href="/InfoOperateServlet?operate=add">新增</a></li>
        </ul>
      </li>
      <li class="dropdown open">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true"><i
                class="fa fa-fw fa-plus"></i> 类目 <span class="caret"></span></a>
        <ul class="dropdown-menu" role="menu">
          <li class="dropdown-header">点单</li>
          <li><a href="/detail">点单列表</a></li>
          <li><a href="/O_I_T">订单信息表</a></li>
          <li><a href="insertCategoryServlet">新增</a></li>
        </ul>
      </li>

      <li>
        <a href=""><i class="fa fa-fw fa-list-alt"></i> 登出</a>
      </li>
    </ul>
  </nav>
  <div id="page-content-wrapper">
    <div class="container-fluid">
      <div class="row clearfix">
        <div class="col-md-12 column">
          <h3 style="text-align: center"><a href="#">订单信息表</a></h3>
          <table class="table table-bordered table-condensed">
            <thead>
              <tr>
                <th>ID</th>
                <th>买家名字</th>
                <th>买家电话</th>
                <th>买家地址</th>
                <th>买家微信openid</th>
                <th>订单总金额</th>
                <th>订单总数量</th>
                <th>订单状态</th>
                <th>支付状态</th>
                <th>创建时间</th>
                <th>修改时间</th>
<%--                colspan--%>
                <th colspan="3">操作</th>
              </tr>
            </thead>
            <tbody>
<%--            类似于增强for循环 var后面的是i item是要循环的列表--%>
            <c:forEach var="master" items="${master}" varStatus="loop">
              <c:choose>
                <c:when test="${loop.index %2 == 1}">
                  <tr class="warning">
                    <td>${master.order_id}</td>
                    <td>${master.buyer_name}</td>
                    <td>${master.buyer_phone}</td>
                    <td>${master.buyer_address}</td>
                    <td>${master.buyer_openid}</td>
                    <td>${master.order_amount}</td>
                    <td>${master.order_total}</td>
                    <td>
                      <c:if test="${master.order_status==0}">
                        <a href="/OITOperateServlet?order_id=${master.order_id}&order_status=${master.order_status}&operate=status">
                          未完成
                        </a>
                      </c:if>
                      <c:if test="${master.order_status==1}">
                        已完成
                      </c:if>
                      <c:if test="${master.order_status==2}">
                        取消
                      </c:if>
                    </td>
                    <td>
                      <c:if test="${master.pay_status==0}">
                        <a href="/OITOperateServlet?order_id=${master.order_id}&pay_status=${master.pay_status}&operate=pay">
                          未支付
                        </a>
                      </c:if>
                      <c:if test="${master.pay_status==1}">
                        已支付
                      </c:if>

                    </td>
                    <td>${master.create_time}</td>
                    <td>${master.update_time}</td>
<%--                    <td>--%>
<%--                      <c:if test="${user.status==0}">--%>
<%--                        <a href="/UserOperateServlet?userId=${user.userId}&status=${user.status}&operate=status">失效</a>--%>
<%--                      </c:if>--%>
<%--                      <c:if test="${user.status==1}">--%>
<%--                        <a href="/UserOperateServlet?userId=${user.userId}&status=${user.status}&operate=status">生效</a>--%>
<%--                      </c:if>--%>
<%--                    </td>--%>
<%--                    <td>${user.createTime}</td>--%>
<%--                    <td>${user.updateTime}</td>--%>
                    <td><a href="/OITOperateServlet?order_id=${master.order_id}&operate=del">删除</a></td>
                    <td><a href="/OITOperateServlet?order_id=${master.order_id}&operate=update">修改</a></td>
                    <td><a href="/OITOperateServlet?order_id=${master.order_id}&operate=details">详情</a></td>
                  </tr>
                </c:when>
                <c:otherwise>
                  <tr class="success">
                    <td>${master.order_id}</td>
                    <td>${master.buyer_name}</td>
                    <td>${master.buyer_phone}</td>
                    <td>${master.buyer_address}</td>
                    <td>${master.buyer_openid}</td>
                    <td>${master.order_amount}</td>
                    <td>${master.order_total}</td>
                    <td>
                      <c:if test="${master.order_status==0}">
                        <a href="/OITOperateServlet?order_id=${master.order_id}&order_status=${master.order_status}&operate=status">
                          未完成
                        </a>
                      </c:if>
                      <c:if test="${master.order_status==1}">
                        已完成
                      </c:if>
                      <c:if test="${master.order_status==2}">
                        取消
                      </c:if>
                    </td>
                    <td>
                      <c:if test="${master.pay_status==0}">
                        <a href="/OITOperateServlet?order_id=${master.order_id}&pay_status=${master.pay_status}&operate=pay">
                          未支付
                        </a>
                      </c:if>
                      <c:if test="${master.pay_status==1}">
                        已支付
                      </c:if>

                    </td>
                    <td>${master.create_time}</td>
                    <td>${master.update_time}</td>
                      <%--                    <td>--%>
                      <%--                      <c:if test="${user.status==0}">--%>
                      <%--                        <a href="/UserOperateServlet?userId=${user.userId}&status=${user.status}&operate=status">失效</a>--%>
                      <%--                      </c:if>--%>
                      <%--                      <c:if test="${user.status==1}">--%>
                      <%--                        <a href="/UserOperateServlet?userId=${user.userId}&status=${user.status}&operate=status">生效</a>--%>
                      <%--                      </c:if>--%>
                      <%--                    </td>--%>
                      <%--                    <td>${user.createTime}</td>--%>
                      <%--                    <td>${user.updateTime}</td>--%>
                    <td><a href="/OITOperateServlet?order_id=${master.order_id}&operate=del">删除</a></td>
                    <td><a href="/OITOperateServlet?order_id=${master.order_id}&operate=update">修改</a></td>
                    <td><a href="/OITOperateServlet?order_id=${master.order_id}&operate=details">详情</a></td>
                  </tr>
                </c:otherwise>
              </c:choose>

            </c:forEach>
            </tbody>
          </table>
        </div>

        <!--                分页-->
        <div class="col-md-12 column">
        </div>
      </div>
    </div>
  </div>

</div>
</body>
</html>
